<?php

namespace app\validate;


use share\validate\SceneValidate;

class UrlPathValidate  extends SceneValidate{
    protected $rule = [
        'id' => 'require|integer',     
        'url_key' => 'require|length:4,50',
        'path' => 'require|length:4,200',
        'url_domain_type' => 'require|length:2,30',
        'name' => 'require|length:2,100',
        'client_type' => 'require|array',
    ];

    protected $sceneRules = [
        'list' => [
            'url_key' => 'length:2,50', 
            'path' =>  'length:2,200', 
            'url_domain_type' =>  'length:1,30', 
            'name' =>  'length:2,30', 
            'client_type' => 'length:1,30',
        ],
        'check' => [
            'ip' => 'ip',
            'vendor' => 'length:2,40',
            'package' => 'length:2,40',
            'version' => 'length:2,40',
            'client' => 'length:2,40',
            'did' => 'length:2,64',
            'client_type' => 'require|integer',
        ],
    ];


    protected $scene = [      
        'set' => ['id','url_key','path','url_domain_type','name','client_type'],
        'del' => ['id'],
        'list' => ['url_key','path','url_domain_type','name','client_type'],   
        'check' => ['ip','vendor','package','version','client','client_type','did'],     
    ];
}